#include <stdlib.h>
#include <inttypes.h>
#include "pmb5010.h"

packet_t *audio_start_recording(uint8_t segments)
{
	packet_t *packet = NULL;
	uint8_t data[] = {segments};

	packet_new(&packet, RID_PMB5010, 0, AUDIO_START_REC, 1, data);

	return packet;
}

packet_t *audio_stop_recording()
{
	packet_t *packet = NULL;

	packet_new(&packet, RID_PMB5010, 0, AUDIO_STOP_REC, 0, NULL);

	return packet;
}

packet_t *audio_start_play()
{
	packet_t *packet = NULL;

	packet_new(&packet, RID_PMB5010, 0, AUDIO_START_PLAY, 0, NULL);

	return packet;
}

packet_t *audio_stop_play()
{
	packet_t *packet = NULL;

	packet_new(&packet, RID_PMB5010, 0, AUDIO_STOP_PLAY, 0, NULL);

	return packet;
}

packet_t *reset_adpcm()
{
	packet_t *packet = NULL;

	packet_new(&packet, RID_PMB5010, 0, ADPCM_RESET, 0, NULL);

	return packet;
}

packet_t *get_picture()
{
	packet_t *packet = NULL;

	packet_new(&packet, RID_PMB5010, 0, TAKE_PICTURE, 0, NULL);

	return packet;
}

packet_t *ping_pmb5010()
{
	packet_t *packet = NULL;
	uint8_t len = 1, data[] = {0};

	packet_new(&packet, RID_PMB5010, 0x00, SYSTEM_COM, len, data);
	
	return packet;
}
